<?php
/**
 * Created by PhpStorm.
 * User: huliren<huliren0516@163.com>
 * Date: 2017/10/30
 * Time: 15:22
 */
define("SITE_AUTH", 'recom-home-circle');

require '../../../common.inc.php';

use Mobile\RecomData;
use lib\core\AdminAction;

class homeCircle extends AdminAction{
    public function doDefault()
    {
        $data = [];
        if (!empty($_POST)) {
            $data_arr = explode(',', trim($_POST['data']));
            foreach ($data_arr as $v) {
                $v = trim($v);
                $data[] = $v;
            }

            RecomData::setData(RecomData::APP_HOME_CIRCLE,$data);
        }

        $smarty = $this->app->page();
        $data = RecomData::getData(RecomData::APP_HOME_CIRCLE)[RecomData::APP_HOME_CIRCLE];
        if(!empty($data)){
            $list = implode(',', $data);
        }
        $smarty->value('key',3);
        $smarty->value('list',$list);
        $smarty->output('recom/circle.tpl');
    }
}
$app->run();